-
Notifications
You must be signed in to change notification settings - Fork 17
feat: support custom metrics events #3038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Yandex Metrica integration to make it more flexible and configurable. The changes move from a simple string-to-number mapping to a structured configuration that supports typed goals and metrica name resolution.
Key changes:
- Introduced a new
yaMetricaConfigstructure that replaces the flatyaMetricaMapproperty - Added a new
reachMetricaGoalhelper function to simplify goal tracking across the application - Integrated metrica tracking for query execution and stopping in the Query Editor components
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/uiFactory/types.ts | Adds yaMetricaConfig with typed goals, replaces yaMetricaMap, and adds generic parameter T for metrica name types |
| src/uiFactory/uiFactory.ts | Updates configureUIFactory signature to support the new generic parameter T |
| src/utils/yaMetrica.ts | Updates to use yaMetricaConfig, makes getMetrica handle optional names, and adds reachMetricaGoal helper function |
| src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx | Adds metrica tracking calls for query execution (execute and explain actions) |
| src/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.tsx | Adds metrica tracking for query stop action |
Comments suppressed due to low confidence (3)
src/utils/yaMetrica.ts:1
- Spreading
querySettingsmay include unnecessary properties in the metrica event. TheQuerySettingstype includes properties likepragmas(string),limitRows(number), and nested configuration objects that could make tracking data verbose and inconsistent. Consider explicitly specifying only the relevant properties (e.g.,queryMode,transactionMode,statisticsMode) to keep tracking data focused and consistent.
import type {UiMetricaGoal} from '../uiFactory/types';
src/utils/yaMetrica.ts:1
- Spreading
querySettingsmay include unnecessary properties in the metrica event. TheQuerySettingstype includes properties likepragmas(string),limitRows(number), and nested configuration objects that could make tracking data verbose and inconsistent. Consider explicitly specifying only the relevant properties (e.g.,queryMode,transactionMode,statisticsMode) to keep tracking data focused and consistent.
import type {UiMetricaGoal} from '../uiFactory/types';
src/utils/yaMetrica.ts:1
- Spreading
querySettingsmay include unnecessary properties in the metrica event. TheQuerySettingstype includes properties likepragmas(string),limitRows(number), and nested configuration objects that could make tracking data verbose and inconsistent. Consider explicitly specifying only the relevant properties (e.g.,queryMode,transactionMode,statisticsMode) to keep tracking data focused and consistent.
import type {UiMetricaGoal} from '../uiFactory/types';
f3cb7ec to
01777a8
Compare
closes #3012
CI Results
Test Status: ❌ FAILED
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: 🔺
Current: 47.10 MB | Main: 47.10 MB
Diff: +5.81 KB (0.01%)
ℹ️ CI Information